From: Matthias Clasen Date: Tue, 14 Dec 2021 04:35:25 +0000 (-0500) Subject: builder: Use GMarkup properly X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~91^2^2~57^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f991428cb95986eb3a1a80eeacc19ec9a051887f;p=gtk4.git builder: Use GMarkup properly We must call end_parse to ensure we get errors for incomplete documents. --- diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c index 0e613ad542..74551bb62e 100644 --- a/gtk/gtkbuilderprecompile.c +++ b/gtk/gtkbuilderprecompile.c @@ -321,10 +321,10 @@ _gtk_buildable_parser_precompile (const char *text, data.root = record_data_tree_new (NULL, RECORD_TYPE_ELEMENT, NULL); data.current = data.root; - ctx = g_markup_parse_context_new (&record_parser, G_MARKUP_TREAT_CDATA_AS_TEXT, - &data, NULL); + ctx = g_markup_parse_context_new (&record_parser, G_MARKUP_TREAT_CDATA_AS_TEXT, &data, NULL); - if (!g_markup_parse_context_parse (ctx, text, text_len, error)) + if (!g_markup_parse_context_parse (ctx, text, text_len, error) || + !g_markup_parse_context_end_parse (ctx, error)) { record_data_tree_free (data.root); g_hash_table_destroy (data.strings);